package com.lvyq.javaprint.view.style;

import javafx.scene.control.Button;

/**
 * @author lvyq 样式设置
 * @version 1.0
 * Create by 2025-01-07 11:36
 */
public class STYLE {


    /**
     * @description 按钮相关
     * @author lvyq
     * @param[1] null
     * @throws

     * @time 2025-01-07 11:37
     */
    public static class BUTTON{
        /**
         * @description 设置按钮划过样式
         * @author lvyq
         * @param[1] button
         * @param[2] normalStyle
         * @param[3] hoverStyle
         * @throws
         * @time 2025-01-07 11:29
         */
        public static void toggle_style(Button button,Boolean isClose) {
            button.getStyleClass().add("normal-button");
            if (isClose){
                button.setOnMouseEntered(e -> button.getStyleClass().setAll("hover-button-close"));
            }else {
                button.setOnMouseEntered(e -> button.getStyleClass().setAll("hover-button"));
            }
            button.setOnMouseExited(e -> button.getStyleClass().setAll("normal-button"));
        }

        public static void toggle_style(Button button) {
            button.getStyleClass().add("normal-button");
            button.setOnMouseEntered(e -> button.getStyleClass().setAll("hover-button"));
            button.setOnMouseExited(e -> button.getStyleClass().setAll("normal-button"));
        }


        public static void info_style(Button button) {
            button.getStyleClass().add("normal-info-button");
            button.setOnMouseEntered(e -> button.getStyleClass().setAll("hover-info-button"));
            button.setOnMouseExited(e -> button.getStyleClass().setAll("normal-info-button"));
        }

        public static void tertiary_style(Button button) {
            button.getStyleClass().add("normal-tertiary-button");
            button.setOnMouseEntered(e -> button.getStyleClass().setAll("hover-tertiary-button"));
            button.setOnMouseExited(e -> button.getStyleClass().setAll("normal-tertiary-button"));
        }

    }
}
